package com.boyinet.activation.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @author lengchunyun
 * @since 2021-01-22
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class Permission implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId()
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @JsonProperty(value = "text")
    private String title;

    private String icon;

    @JsonProperty(value = "link")
    private String herf;

    private String target;

    private Integer type;

    @TableField("`group`")
    private Boolean group;

    private Boolean hideInBreadcrumb;

    private Long pid;

    @TableField(exist = false)
    private List<Permission> children;

    @TableField(exist = false)
    private Integer level;


}
